﻿using ICSharpCode.TextEditor.Document;

using MyHostSwtich.Core;

using System;
using System.IO;
using System.Windows.Forms;

namespace MyHostSwtich
{
    static class Program
    {

        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            if(!Utils.Instance.IsAdministrator())
            {
                MessageBox.Show(
                    "请使用管理员权限运行该程序.", "提示", 
                    MessageBoxButtons.OK, MessageBoxIcon.Information
                );
                return;
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            LoadHighlightingProvider();

            var frmMain = new frmMain();
            Application.Run(frmMain);
        }

        private static void LoadHighlightingProvider()
        {
            var path = Path.GetDirectoryName(@"./Lang");
            FileSyntaxModeProvider syntaxModeFileProvider = new FileSyntaxModeProvider(path);
            HighlightingManager.Manager.AddSyntaxModeFileProvider(syntaxModeFileProvider);
        }

    }

}
